<?php
class AAsignacionTurno
{
	public function __construct() {}
	public function asignacionTurno(EFacade & $facade) 
	{
		$doc = & $facade->getDocumentRoot();
		/***************** roto los grupos de la rotacion turno ******/
//		$doc->rotacion->rotar();
//		$doc->rotacionTurno->rotar();
//		
//		foreach($doc->rotacion->grupo as $gru){
//			echo "<br>*******************************";
//			echo "<br>",$gru;
//			$gru->epSetDirty(TRUE);
//			$gru->epSetCommittable(TRUE);
//			$gru->commit();
//			echo "<br>",$gru->estaEnElTurno;
//			$gru->estaEnElTurno->commit();
//			echo "<br>",$gru->estaEnElPlan;
//			$gru->estaEnElPlan->commit();
//		}
		//$doc->rotacion->commit();
		//$doc->rotacionTurno->commit();
		$workflowSA = & $facade->getWorkflow();
		$transSetSA = & EFacade :: getCurrentTransSetAuto($workflowSA, 2); //TYPE AUTO AGENT
		$role=NULL;
		$transSA = $transSetSA->getTransByName('t2');
		$facade->fireTrans($transSA,$role,'asigno turno', TRUE);
	}
}
?>